package Gui;

import javax.swing.*;
import java.awt.*;

public class MyFrame2 extends JFrame {
    JPanel jp1,jp2,jp3;
    JCheckBox checkBox1,checkBox2,checkBox3;
    ButtonGroup group;
    JRadioButton radioButton1,radioButton2;
    JLabel lable1,lable2;
    JButton button1,button2;


    public static void main(String[] args) {
        MyFrame2 myFrame2 = new MyFrame2();
    }

    public MyFrame2(){
        init();
        setTitle("用户注册界面");
        setBounds(600,600,600,400);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    void init(){
        setLayout(new GridLayout(3,1));
        jp1= new JPanel();
        jp2 = new JPanel();
        jp3 = new JPanel();

        lable1 = new JLabel("你喜欢的运动");
        lable2 = new JLabel("你的性别");

        checkBox1 = new JCheckBox("足球");
        checkBox2 = new JCheckBox("篮球");
        checkBox3 = new JCheckBox("羽毛球");

        radioButton1 = new JRadioButton("男");
        radioButton2 = new JRadioButton("女");

        button1 = new JButton("注册用户");
        button2 = new JButton("取消用户");

        group = new ButtonGroup();
        group.add(radioButton1);
        group.add(radioButton2);

        jp1.add(lable1);
        jp1.add(checkBox1);
        jp1.add(checkBox2);
        jp1.add(checkBox3);

        jp2.add(lable2);
        jp2.add(radioButton1);
        jp2.add(radioButton2);

        jp3.add(button1);
        jp3.add(button2);

        add(jp1);
        add(jp2);
        add(jp3);
    }
}
